const express=require('express');
const db=require('../utils/db.js');

const router=express.Router();

router.get('/addaddress',(req,res)=>{
	// const inserSql=`INSERT INTO location VALUES(null,'李','18854138766','上海黄浦区臧南路','3号','公司','女士','1')`;
	const inserSql=`INSERT INTO location VALUES(null,'${req.query.username}','${req.query.phone}','${req.query.address}','${req.query.doorNumber}','${req.query.addressStyle}','${req.query.sex}','${req.query.userid}')`;
	db.query(inserSql,(err,data)=>{
		if(err==null){//插入成功
			res.send({msg:'保存成功'})
		}else{
			// res.send('出错')
			res.send({msg:err})
		}
	})
})

module.exports=router;